package cloudnative.demo.labclient.client;

import cloudnative.demo.labclient.model.Manager;
import cloudnative.demo.labclient.model.Student;
import cloudnative.demo.labclient.model.Teacher;
import org.springframework.cloud.openfeign.FeignClient;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;
import java.util.List;
@FeignClient(name="lab-service")
public interface PersonnelServiceClient {
    // 增加教师接口
    @PostMapping("/personnel/addT")
    void addTeacher(@RequestBody Teacher teacher);

    // 增加学生接口
    @PostMapping("/personnel/addS")
    void addStudent(@RequestBody Student student);

    // 增加管理员接口
    @PostMapping("/personnel/addM")
    void addManager(@RequestBody Manager manager);

    // 查询所有教师
    @GetMapping("/personnel/queryT")
    List<Teacher> queryAllTeachers();

    // 查询所有学生
    @GetMapping("/personnel/queryS")
    List<Student> queryAllStudents() ;

    // 查询所有管理员
    @GetMapping("/personnel/queryM")
    List<Manager> queryAllManagers() ;

    // 按名字和ID查询学生
    @PostMapping("/personnel/querySBNID")
    List<Student> queryStudentByNameAndId(@RequestBody Student student) ;

    // 按名字和ID查询管理员
    @PostMapping("/personnel/queryMBNID")
    List<Manager> queryManagerByNameAndId(@RequestBody Manager manager) ;

    // 按名字和ID查询教师
    @PostMapping("/personnel/queryTBNID")
    List<Teacher> queryTeacherByNameAndId(@RequestBody Teacher teacher) ;

    // 删除教师接口
    @PostMapping("/personnel/deleteT")
    void deleteTeacher(@RequestBody Teacher teacher);

    // 删除学生接口
    @PostMapping("/personnel/deleteS")
    void deleteStudent(@RequestBody Student student);

    // 删除管理员接口
    @PostMapping("/personnel//deleteM")
    void deleteManager(@RequestBody Manager manager);

    // 更新教师信息
    @PostMapping("/personnel//alterT")
    void updateTeacher(@RequestBody Teacher teacher) ;

    // 更新学生信息
    @PostMapping("/personnel//alterS")
    void updateStudent(@RequestBody Student student) ;

    // 更新管理员信息
    @PostMapping("/personnel//alterM")
    void updateManager(@RequestBody Manager manager) ;
}
